import java.util.Scanner;
//求斐波那契数列的第n项。(迭代实现)
public class Homework1 {
    public static int fun(int n){
        if(n==1){
            return 1;
        }else if(n==2){
            return 1;
        }else{
            return fun(n-1)+fun(n-2);
        }
    }
    public static void main(String[] args) {
        System.out.println("Hello world!");
        Scanner input = new Scanner(System.in);
        System.out.println("请输入项数：");
        int a = input.nextInt();
        int b = fun(a);
        System.out.println("菲波那切数列的第"+a+"项的数值是:"+b);
    }
}